package com.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.entity.ProductImage;

@Repository
public class ProductImageDAO extends BaseDAO<ProductImage> {
	private static final String PRODUCT_ID = "production.id";
	private static final String SORT = "imageSort";
	public ProductImageDAO() {
		super(ProductImage.class);
	}
	
	public List<ProductImage> findRotateImage(){
		return this.findByProperty(ProductImage.IS_ROTATE, true, ProductImage.IMAGE_SORT);
	}
	
	public List<ProductImage> findByProduct(int productId){
		return this.findByProperty(PRODUCT_ID, productId, SORT);
	}

}
